//
//  WRYNewController.m
//  BaiSiBuJie
//
//  Created by wry on 16/4/24.
//  Copyright © 2016年 WRY. All rights reserved.
//

#import "WRYNewController.h"
#import "UIBarButtonItem+WRYHighlightButton.h"
#import "WRYAllController.h"
#import "WRYVideoController.h"
#import "WRYVoiceController.h"
#import "WRYPictureController.h"
#import "WRYTextViewController.h"


@interface WRYNewController ()

@end

@implementation WRYNewController

- (void)viewDidLoad {
    [super viewDidLoad];
//1.设置到航条
    [self setNavcBarItem];

    //2. 添加所有的子控制器
    [self setUpAllChildVC];
}

-(void)setUpAllChildVC
{
    //全部
    WRYAllController *allVC=[[WRYAllController alloc]init];
    allVC.title=@"全部";
    [self addChildViewController:allVC];
    //视频
    WRYVideoController *videoVC=[[WRYVideoController alloc]init];
    videoVC.title=@"视频";
    [self addChildViewController:videoVC];
    //声音
    WRYVoiceController *voiceVC=[[WRYVoiceController alloc]init];
    voiceVC.title=@"声音";
    [self addChildViewController:voiceVC];
    //图片
    WRYPictureController *pictureVC=[[WRYPictureController alloc]init];
    pictureVC.title=@"图片";
    [self addChildViewController:pictureVC];
    //段子
    WRYTextViewController *textVC=[[WRYTextViewController alloc]init];
    textVC.title=@"段子";
    [self addChildViewController:textVC];
   
}

//1.设置到航条
-(void)setNavcBarItem
{
    UIBarButtonItem *itemLeft=[UIBarButtonItem itemWithNormalImage:[UIImage imageNamed:@"nav_item_game_icon"] highlightImage:[UIImage imageNamed:@"nav_item_game_click_icon"] target:self action:@selector(itemLeftClick)];
    self.navigationItem.leftBarButtonItem=itemLeft;
    
    UIBarButtonItem *itemRight=[UIBarButtonItem itemWithNormalImage:[UIImage imageNamed:@"navigationButtonRandom"] highlightImage:[UIImage imageNamed:@"navigationButtonRandomClickN"] target:self action:@selector(itemRightClick)];
    self.navigationItem.rightBarButtonItem=itemRight;
    
    self.navigationItem.titleView=[[UIImageView alloc]initWithImage:[UIImage imageWitnOriginImageNamed:@"MainTitle"]];
    
}
//
-(void)itemLeftClick
{
    NSLog(@"游戏");
}
-(void)itemRightClick
{
    NSLog(@"wwwww");
}

@end
